import java.util.Comparator;
import java.util.Objects;

class MY_hhh<J>{
    Object[] h = new Object[10];

    public void set_h(int poi, J val) {
        h[poi] = val;
    }

    public J get_h(int poi) {
        return (J)h[poi];
    }
}

class Max_p<E extends Comparable<E>>{

    E Max_arr(E[] arr) {
        E max = arr[0];
        for (int i = 1; i < arr.length; i++) {
            if (max.compareTo(arr[i]) < 0) {
                max = arr[i];
            }
        }
        return max;
    }
}

//class Person implements Comparable {
//
//    int[] arr = {1, 2, 3, 4, 5};
//    @Override
//    public int compareTo(Object o) {
//        return 0;
//    }
//}
public class _fanxing_ {

    public static void main(String[] args) {
        Max_p<Integer> one = new Max_p<>();
        Integer[] arr = {1, 2, 3, 4, 5};
        System.out.println(one.Max_arr(arr));
    }
    public static void main1(String[] args) {
        //使用<>规定只能储存这个类型
        MY_hhh<Integer> h = new MY_hhh<>();//只能写int类型的
        h.set_h(0, 1);
        h.set_h(1, 2);
        int hh = h.get_h(0);
        double i = h.get_h(1);//Double wo = wow.doubleValue();
        System.out.println(i);
    }

    public static void main0(String[] args) {
        MY_hhh H = new MY_hhh();
        H.set_h(0, "hadage");
        H.set_h(1, 11);
        H.set_h(2, 1.222);
        int i = (int) H.get_h(1);
        String i1 = (String) H.get_h(0);
//        String i2 = (String) H.get_h(1);
        System.out.println(i + " " + i1);
    }
}
